GATE CSE 2004
Q41.
Suppose we run Dijkstra's single source shortest-path algorithm on the following edge-weighted directed graph with vertex P as the source. In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized?Q42.
A single array A[1...MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top 2 (top1 \lt top 2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for "stack full" isQ43.
Assume that the operators +, -, x , are left associative and ^ is right associative. the order of precedence (from highest to lowest) is ^, x , +, -. The postfix expression corresponding to the infix expression a + b x c-d^e^f isQ44.
The best data structure to check whether an arithmetic expression has balanced parentheses is aQ45.
Consider the following statements with respect to user-level threads and kernel-supported threads (i) context switch is faster with kernel-supported threads (ii) for user-level threads, a system call can block the entire process (iii) Kernel supported threads can be scheduled independently (iv) User level threads are transparent to the kernel Which of the above statements are true?Q46.
Consider the partial implementation of a 2-bit counter using T flip-flops following the sequence 0-2-3- 1-0, as shown below. To complete the circuit, the input X should beQ47.
In an SR latch made by cross-coupling two NAND gates, if both S and R inputs are set to 0, then it will result in